package cn.zswltech.gruul.biz.service;

import cn.zswltech.gruul.common.result.Response;
import cn.zswltech.gruul.common.entity.DisplayMenuTreeDO;
import cn.zswltech.gruul.common.entity.UserDO;
import cn.zswltech.gruul.common.dal.query.LoginQuery;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

public interface LoginService {
    Response<Map> userLogin(HttpServletResponse response, UserDO userDO, String ipAddr);

    Response<DisplayMenuTreeDO> getMenuTrees(UserDO loginUser);

    /**
     * 检查用户是否拥有菜单或者功能权限
     *
     * @param account
     * @param servletPath 请求path
     * @param method      方法类型 get post put delete
     * @param functionCode
     * @return true拥有 false没有
     */
    boolean checkUserMenuOrFunction(String account, String servletPath, String method, String functionCode,Long menuId);

    /**
     * 校验用户是否有menu的权限
     */
    boolean checkUserMenu(Long userId, String dashboardSSOTargetPath);

    Response checkUser(UserDO userDO, HttpServletResponse response);

    Response getAuthCode(LoginQuery query,HttpServletRequest request);


}
